package com.nightsoul.cxf;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;

public class MyPreInvokeInterceptor extends AbstractPhaseInterceptor<Message> {

	public MyPreInvokeInterceptor() {
		super(Phase.PRE_INVOKE);
	}

	@Override
	public void handleMessage(Message message) throws Fault {
		System.out.println("handle message in " + this.getClass().getName());			
	}

	@Override
	public void handleFault(Message message) {
		System.out.println(message.get(Throwable.class));
		System.out.println("handle fault in " + this.getClass().getName());	
	}
}
